<template>
  <el-dialog
    :visible="visible"
    title="修改"
    width="20%"
  >
    <el-form layout="vertical">
      <el-form-item label="文件夹名称">
        <el-input v-model="params.fileName" />
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="$emit('cancel')">取 消</el-button>
      <el-button type="primary" @click="create">确定修改</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  name: 'MyContentEdit',
  props: {
    visible: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      params: {}
    }
  },
  methods: {
    getName(item) {
      this.params = item
    },
    create() {
      if (this.params.fileName === '') return this.$message.warning('文件名不能为空！')
      const newShare = {
        ...this.params
      }
      this.$put('/fileadmin/update', newShare).then(res => {
        this.$emit('create')
      })
    }
  }
}
</script>

<style scoped>

</style>
